/*
 * @Author: your name
 * @Date: 2021-11-16 18:24:06
 * @LastEditTime: 2023-06-15 17:27:13
 * @LastEditors: liutongchao 1923236391@qq.com
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \go_work\src\xiaoshuo\models\demo.go
 */
package models

import (
	_ "greenbeeadmin/models/commons"

	"github.com/beego/beego/v2/client/orm"
	_ "github.com/go-sql-driver/mysql" // import your used driver
)

type SystemSetting struct {
	Id          int    `json:"id"`
	Types       string `json:"types"`
	Gonggao     string `json:"gonggao"`
	Record      string `json:"record"`
	PortalUrl   string `json:"portal_url"`
	Tongji      string `json:"tongji"`
	Powerby     string `json:"powerby"`
	WebName     string `json:"web_name"`
	FileTypes   string `json:"file_types"`
	FileMaxSize int    `json:"file_max_size"`
}

func init() {
	// register model 注册模型
	//orm.RegisterModel(new(AdminUser))
	orm.RegisterModelWithPrefix("go_", new(SystemSetting))
	// create table 参数二：true创建表     参数三：true更新表
	//orm.RunSyncdb("default", false, true)
}

// 设置引擎为 INNODB
func (u *SystemSetting) TableEngine() string {
	return "INNODB"
}

// 获取数据表名
func (u *SystemSetting) GetTableName() string {
	return "go_system_setting"
}
